#ifndef _SF_DEBUG_H_
#define _SF_DEBUG_H_

#ifdef __cplusplus
extern "C" {
#endif



//#define DEBUG

#ifdef SF_DEBUG
#define DPRINTK(fmt, args...)	printf("(%s,%d)%s: " fmt,__FILE__,__LINE__, __FUNCTION__ , ## args)
#else
#define DPRINTK(fmt, args...)
#endif

/* #define USE_BUDDY_MEMORY  1*/

#ifdef USE_BUDDY_MEMORY
extern void __memInit(void);
extern void __memUnInit(void);
extern void* rj_malloc(unsigned int pid, unsigned int size, unsigned char* file, unsigned int line);
extern unsigned int rj_free(void* ptr, unsigned char* file, unsigned int line);

#define RJ_MALLOC(size) rj_malloc(pthread_self(), size, __FUNCTION__, __LINE__);
#define RJ_FREE(ptr) rj_free(ptr, __FUNCTION__, __LINE__);
#else

#define RJ_MALLOC(size) malloc(size)
#define RJ_FREE(ptr) free(ptr)
#endif

#ifdef __cplusplus
}
#endif

#endif 
